package cn.com.lms.business.questionnaire.persistence.entity;

import com.bnzj.core.persistence.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.util.List;

/**
 * @Author: 16266
 * @DateTime: 2020/3/25 10:31
 * @Description: 用户问卷实体
 */
@Entity
@Getter
@Setter
@ToString(callSuper = true)
@Table(name = "bnz_user_questionnaire", schema = "bnzj")
public class UserQuestionnaire extends BaseEntity {

    private static final long serialVersionUID = -7575979317758163766L;

    @Schema(description = "学习计划ID")
    private Long planId;

    @Schema(description = "阶段Id")
    private Long stageId;

    @Schema(description = "详情阶段ID")
    private Long stageDetailId;

    @Schema(description = "用户Id")
    private Long userId;

    @Schema(description = "问卷信息主表ID")
    private Long questionnaireInfoId;

    @Schema(description = "问卷题目选项")
    @OneToMany(targetEntity = UserQuestionnaireOpt.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "questionnaireInfoId", referencedColumnName = "questionnaireInfoId")
    private List<UserQuestionnaireOpt> userQuestionnaireOptList;
}


